import random
max = 100
min = 0
answer = random.randint(0,100)

while True:
    while True:
        number = int(input("你猜一个数字在{min}到{max}之间，看看是否和我心里想的一样？".format(min,max)))
        if number == answer:
            print("猜中了，请喝酒")
            break
        elif number < min or number > max:
            print("不在范围之内，重新猜")
            continue
        elif 0 < number and number < answer:
            print("你猜的范围在{min}到{answer}之间".format(min,answer))
            continue
        elif number >answer and number < max:
            print("你猜的范围在{answer}到{max}之间".format(answer,max))
            continue
        
    command = input("是否继续游戏")
    if command == "NO":
        # 回到第6行
        break
    elif command == "YES" 
    #     #退出
    #     break
    else: 